import request from "@/utils/serviceApiH2";

/* 金刚区 */

// 新增服务
export function addServeApi(data) {
  return request({
    url: "/apiH2/admin/content/serve/addServe",
    method: "POST",
    data
  });
}

// 删除页面信息
export function delTopByIdApi(id) {
  return request({
    url: `/apiH2/admin/content/serve/delTopById/${id}`,
    method: "DELETE",
  });
}

// 服务列表查询
export function selServeListApi(params) {
  return request({
    url: "/apiH2/admin/content/serve/selServeList",
    method: "GET", 
    params,
  });
}

// 查询顶部服务信息
export function selTopByIdApi(id) {
  return request({
    url: `/apiH2/admin/content/serve/selTopById/${id}`,
    method: "GET",
  });
}

// 修改服务信息
export function updateServeByIdApi(data,id) {
  return request({
    url: `/apiH2/admin/content/serve/updateServeById/${id}`,
    method: "PUT",
    data,
  });
}

// 修改顶部服务状态
export function updateServeStatusByIdApi(id) {
  return request({
    url: `/apiH2/admin/content/serve/updateServeStatusById/${id}`,
    method: "PUT",
  });
}

// 修改顶部服务序号
export function updateServeSNApi(params) {
  return request({
    url: "/apiH2/admin/content/serve/updateServeSN",
    method: "PUT",
    params,
  });
}

/* 页面地址 */

// 跳转页面列表查询
export function selPageUrlListApi(params) {
  return request({
    url: "/apiH2/admin/page/page/selPageUrlList",
    method: "GET",
    params
  });
}

// 新增跳转页面
export function addPageUrlApi(params) {
  return request({
    url: "/apiH2/admin/page/page/addPageUrl",
    method: "POST",
    params
  });
}

// 删除跳转页面信息
export function delPageUrlByIdApi(id) {
  return request({
    url: `/apiH2/admin/page/page/delPageUrlById/${id}`,
    method: "DELETE",
  });
}

// 修改跳转页面
export function updatePageUrlByIdApi(params) {
  return request({
    url: `/apiH2/admin/page/page/updatePageUrlById/${params.id}`,
    method: "POST",
    params: {
      ifParameter: params.ifParameter,
      jumpType: params.jumpType,
      jumpUrl: params.jumpUrl,
      name: params.name,
    },
  });
}